(bug 36761) "Mark pages as visited" should submit previously established filter options
authorAaron Pramana <aaron@sociotopia.com>
Mon, 21 May 2012 03:21:33 +0000 (20:21 -0700)
committerAaron Pramana <aaron@sociotopia.com>
Tue, 22 May 2012 03:17:38 +0000 (20:17 -0700)
The form was missing the hidden inputs containing the filter options already selected. This change fixes adds those inputs.

Change-Id: I67f3b34672c52c13789a967e81e0cb32813b2be2

RELEASE-NOTES-1.20
includes/specials/SpecialWatchlist.php

index 8875eeb..c8960f0 100644 (file)
@@ -125,6 +125,7 @@ upgrade PHP if you have not done so prior to upgrading MediaWiki.
 * (bug 34927) Output media_type for list=filearchive
 * (bug 28814) add properties to output of action=parse
 * (bug 33224) add variants of content language to meta=siteinfo
+* (bug 36761) "Mark pages as visited" now submits previously established filter options
 
 === Languages updated in 1.20 ===
 
index eafdde4..a81eb5b 100644 (file)
@@ -91,14 +91,6 @@ class SpecialWatchlist extends SpecialPage {
                        return;
                }
 
-               if( ( $wgEnotifWatchlist || $wgShowUpdatedMarker ) && $request->getVal( 'reset' ) &&
-                       $request->wasPosted() )
-               {
-                       $user->clearAllNotifications();
-                       $output->redirect( $this->getTitle()->getFullUrl() );
-                       return;
-               }
-
                $nitems = $this->countItems();
                if ( $nitems == 0 ) {
                        $output->addWikiMsg( 'nowatchlist' );
@@ -152,16 +144,16 @@ class SpecialWatchlist extends SpecialPage {
                $invert = $request->getBool( 'invert' );
                $associated = $request->getBool( 'associated' );
                if ( !is_null( $nameSpace ) ) {
-                       $eq_op = $invert ? '!=' : '=';\r
+                       $eq_op = $invert ? '!=' : '=';
                        $bool_op = $invert ? 'AND' : 'OR';
                        $nameSpace = intval( $nameSpace ); // paranioa
                        if ( !$associated ) {
                                $nameSpaceClause = "rc_namespace $eq_op $nameSpace";
                        } else {
-                               $associatedNS = MWNamespace::getAssociated( $nameSpace );\r
+                               $associatedNS = MWNamespace::getAssociated( $nameSpace );
                                $nameSpaceClause =
-                                       "rc_namespace $eq_op $nameSpace " .\r
-                                       $bool_op .\r
+                                       "rc_namespace $eq_op $nameSpace " .
+                                       $bool_op .
                                        " rc_namespace $eq_op $associatedNS";
                        }
                } else {
@@ -190,6 +182,14 @@ class SpecialWatchlist extends SpecialPage {
                        wfAppendToArrayIfNotDefault( $name, $values[$name], $defaults, $nondefaults );
                }
 
+               if( ( $wgEnotifWatchlist || $wgShowUpdatedMarker ) && $request->getVal( 'reset' ) &&
+                       $request->wasPosted() )
+               {
+                       $user->clearAllNotifications();
+                       $output->redirect( $this->getTitle()->getFullUrl( $nondefaults ) );
+                       return;
+               }
+
                $dbr = wfGetDB( DB_SLAVE, 'watchlist' );
 
                # Possible where conditions
@@ -263,8 +263,11 @@ class SpecialWatchlist extends SpecialPage {
                                                'id' => 'mw-watchlist-resetbutton' ) ) .
                                        $this->msg( 'wlheader-showupdated' )->parse() . ' ' .
                                        Xml::submitButton( $this->msg( 'enotif_reset' )->text(), array( 'name' => 'dummy' ) ) .
-                                       Html::hidden( 'reset', 'all' ) .
-                                       Xml::closeElement( 'form' );
+                                       Html::hidden( 'reset', 'all' );
+                                       foreach ( $nondefaults as $key => $value ) {
+                                               $form .= Html::hidden( $key, $value );
+                                       }
+                                       $form .= Xml::closeElement( 'form' );
                }
                $form .= '<hr />';